﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace Derbster.Domain
{
    public class Command
    {
        private readonly Action _redo;
        private readonly Action _undo;

        public Command(Action redoAction, Action undoAction)
        {
            Contract.Requires(redoAction != null);
            Contract.Requires(undoAction != null);

            _redo = redoAction;
            _undo = undoAction;
        }

        public void Redo()
        {
            _redo();
        }

        public void Undo()
        {
            _undo();
        }}
}
